/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.N070;
import queenb.web.util.PackageContants;

/**
 *
 * @author Hung.Ngo
 */
public class N070Store extends N070 {

    public int updateN070(int pnFN100P, int pnFN100C, int pnFN050,String pvNV071, int pnFH000, int pnFH200, String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.UPDATE_N070, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFN100P),
                        new Param(OracleTypes.INTEGER, pnFN100C),
                        new Param(OracleTypes.INTEGER, pnFN050),
                         new Param(OracleTypes.CHAR, pvNV071),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                       
                        new Param(OracleTypes.CHAR, pvLOGIN)});

            return super.update(updateStatement, N070.class);
        } catch (SQLException ex) {
            Logger.getLogger(N070Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }

     public List<N070> getListN050(int pnFH000, int pnFH200,int pnFN100P, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_N070, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                     new Param(OracleTypes.INTEGER, pnFN100P),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        return super.find(dataStatement, N070.class);
    }
}
